/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package assignment_cp3120.administrator.editmanager;

import assignment_cp3120.DAO.Factory.DAOFactory;
import assignment_cp3120.user.registeruser.RegisterUserModel;

/**
 *
 * @author Administrator
 */
public class EditManagerModel extends RegisterUserModel {
    private String manager;

    @Override public boolean isUniqueUsername(){
        boolean unique = true;
        
        unique = super.isUniqueUsername();
        
        if(manager.equals(getUsername())){
            unique = true;
        }        
        return unique;
    }
    public String getManager() {
        return manager;
    }
    public void setManager(String manager) {
        this.manager = manager;
    }
    public boolean managerIsManager(){
        return DAOFactory.getDAOFactory().getUserDAO().getUser(manager).isManager();
    }
    
}
